<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>cookie</title>
</head>
<style>
    body {
        margin: 0;
        padding: 0;
        font-family: sana-fserif;
        background: #34495e;
    }

    form{
        width: 450px;
        height:350px;
        background-color:whitesmoke;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;   /*表单中的内容垂直居中*/
    }

    /* h2{
        text-align: center;    // 属性继承 这里不用设置
        vertical-align: middle;
    }; */

    .box{
        width: 80%;
        text-align: center;
        vertical-align: middle;
        padding: 30px;
        margin: 10px auto;
    }

    /* 设置输入用户名和密码样式 */
    .input1 {
        width: 80%;
        height: 20px;
        border: 1px solid rgba(21, 21, 21, 0.1);
        display: block;
        margin: 15px auto;
        padding: 14px 10px;
    }

    /* 设置登录按钮样式*/
    .input2 {
        width: 80%;
        height: 30px;
        background-color:skyblue;
        border: 1px solid rgba(21, 21, 21, 0.1);
        display: block;
        margin: 15px auto;
        padding: 14px 10px;
        text-align: center;
    };

    /* 设置鼠标移人到按钮上的样式 */
    .box input[type="submit"]:hover{
        background: white;
    }
</style>
<body>
    <form action="/login" method="post">
        <h2>模拟登录页面</h2>
        <div class="box">
            <input class='input1' type="text" name="usename" id="username" placeholder="输入用户名">
            <input class='input1' type="text" name="password" id="password" placeholder="输入密码">
            <input class='input2' type="submit"/>
        </div>
    </form>
</body>
</html>